﻿using System;
using System.Collections.Generic;
using System.Text;


namespace Atosenet.Data
{
    public abstract class AtosDeviceInfo
    {
        private AtosDeviceType _deviceType = AtosDeviceType.None;

        public AtosDeviceInfo(AtosDeviceType type)
        {
            _deviceType = type;
        }

        public static AtosDeviceInfo CreateInstance(AtosDeviceType type, byte[] rfData)
        {
            switch (type)
            {
                case AtosDeviceType.PC:
                    return new DeviceInfoPC(rfData);
                case AtosDeviceType.BaseStation:
                    return new DeviceInfoBaseStation(rfData);
                case  AtosDeviceType.Node:
                    return new DeviceInfoNode(rfData);
                case AtosDeviceType.None:
                case AtosDeviceType.Other:
                default:
                    return null;
            }
        }

        public AtosDeviceType DeviceType
        {
            get { return _deviceType; }
        }

        public abstract byte[] RfData { get; set; }
    }


    public enum AtosDeviceType
    {
        None = 0x00,
        PC = 0x01,
        BaseStation = 0x02,
        Node = 0x03,
        Other = 0x04
    }
}
